/*
 * Copyright (c) 2022, tyustli
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author       Notes
 * 2022-02-08     tyustli      first implementation
 */

#include <stdio.h>
#include <math.h>

static int nxn_func(int value)
{
    if (value <= 0)
        return 0;
    else if (value == 1)
        return 1;
    else
        return value * nxn_func(value - 1);
}

int main(int argc, char **argv)
{
    printf("%d\r\n", nxn_func(0));
    printf("%d\r\n", nxn_func(1));
    printf("%d\r\n", nxn_func(2));
    printf("%d\r\n", nxn_func(3));
    printf("%d\r\n", nxn_func(4));
    printf("%d\r\n", nxn_func(5));
    printf("%d\r\n", nxn_func(6));

    return 0;
}

/******************** end of file **********************/
